package com.ruoyi.system.api.factory;

import com.ruoyi.system.api.RemoteBmCodeService;
import com.ruoyi.system.api.domain.RemoteSysBmType;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 物资编码服务
 *
 * @author yy
 */
@Component
public class RemoteBmCodeFallbackFactory implements FallbackFactory<RemoteBmCodeService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteBmCodeFallbackFactory.class);

    @Override
    public RemoteBmCodeService create(Throwable throwable) {
        log.error("物资编码服务调用失败:{}", throwable.getMessage());
        return new RemoteBmCodeService() {
            @Override
            public RemoteSysBmType genCode(Long sysBmId, String codeType) {
                return null;
            }

            @Override
            public Map genCodeWithAll(Long sysBmId) {
                return null;
            }

            @Override
            public RemoteSysBmType getCodeByGenCode(String genCode, String codeType) {
                return null;
            }

            @Override
            public RemoteSysBmType genGoodsCode(Long sysBmId, String materialName) {
                return null;
            }

            @Override
            public List<RemoteSysBmType> queryGoodsCode(RemoteSysBmType remoteSysBmType) {
                return null;
            }
        };
    }
}
